package cn.com.nes.site.controller.inventory;

import cn.com.nes.common.web.CommonResult;
import cn.com.nes.site.entity.vo.inventory.SaveGoodsTypeVo;
import cn.com.nes.site.service.inventory.BusinessGoodsTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Api(tags = {"项目模块 - 库存管理接口"})
@Controller
@RequestMapping("/v2/inventory/goods")
public class GoodsController {
    @Resource
    private BusinessGoodsTypeService businessGoodsTypeService;

    @ApiOperation("保存货品类别")
    @RequestMapping(value = "saveGoodsType", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<?> saveGoodsType(@RequestBody @Validated SaveGoodsTypeVo vo) throws Exception {
        boolean res = businessGoodsTypeService.saveGoodsType(vo);
        return CommonResult.ok();
    }
}
